﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="WarehouseHistory.aspx.cs" Inherits="Inventory_WarehouseHistory" Title="库存单据历史" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table>
        <tr>
            <td style="height: 210px">
                <asp:GridView ID="GridViewHistory" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" 
                 DataKeyNames="ListType,ListID"
                BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical" AllowPaging="True" AllowSorting="True" OnRowCommand="GridViewHistory_RowCommand" >
                    <Columns>
                        <asp:BoundField DataField="ListType" HeaderText="ListType" SortExpression="ListType" Visible="False" />
                        <asp:BoundField DataField="ListTypeName" HeaderText="单据类型" ReadOnly="True" SortExpression="ListTypeName" />
                        <asp:BoundField DataField="ListID" HeaderText="ListID" SortExpression="ListID" Visible="False" />
                        <asp:BoundField DataField="ListNumber" HeaderText="单据号" SortExpression="ListNumber" />
                        <asp:BoundField DataField="WarehouseName" HeaderText="仓库" SortExpression="WarehouseName" />
                        <asp:BoundField DataField="CreatedDate" HeaderText="日期" SortExpression="CreatedDate" />
                        <asp:ButtonField ButtonType="Button" CommandName="Open" Text="查看" />
                        <asp:ButtonField ButtonType="Button" CommandName="DeleteList" Text="删除" />
                    </Columns>
                    <FooterStyle BackColor="#CCCC99" />
                    <RowStyle BackColor="#F7F7DE" />
                    <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                    <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DBConnectionString %>"
                    SelectCommand="SELECT [ListType],case [ListType] when 0 then '出库' else '入库' end as [ListTypeName] , [ListID], [ListNumber], [WarehouseName], [CreatedDate] FROM [View_InventoryHistory],[tbl_Warehouse] WHERE [View_InventoryHistory].[WarehouseID] = [tbl_Warehouse].[WarehouseID]  ORDER BY [CreatedDate] DESC">
                </asp:SqlDataSource>
            </td>
        </tr>
    </table>
</asp:Content>

